package net.sk.china.front.service.order;

import com.baomidou.mybatisplus.extension.service.IService;
import net.sk.china.common.model.order.StoreOrder;
import net.sk.china.common.request.PageParamRequest;
import net.sk.china.common.response.CommonPage;
import net.sk.china.front.request.order.*;
import net.sk.china.front.response.order.*;

import java.util.List;
import java.util.Map;

/**
 * StoreOrderService 接口实现
 * +----------------------------------------------------------------------
 * | Talk To [ 聊来改善地区金融服务环境，助力企业发展 ]
 * +----------------------------------------------------------------------
 * | Copyright (c) 2018-2024 聊来All rights reserved.
 * +----------------------------------------------------------------------
 * | Licensed ( <a href="http://www.apache.org/licenses/LICENSE-2.0">apache</a> )
 * +----------------------------------------------------------------------
 * | @Author: 聊来 <18970881148@qq.com>
 * +----------------------------------------------------------------------
 * | DateTime: 2024/6/12 20:52
 * +----------------------------------------------------------------------
 */
public interface StoreOrderService extends IService<StoreOrder> {

    /**
     * 订单预下单
     * @param request 预下单请求参数
     * @return {@code Map<String, Object>}
     */
    Map<String, Object> preOrder(PreOrderRequest request);

    /**
     * 加载预下单信息
     * @param preOrderNo 预下单号
     * @return 预下单信息
     */
    PreOrderResponse loadPreOrder(String preOrderNo);

    /**
     * 计算订单价格
     * @param request 计算订单价格请求对象
     * @return {@code ComputedOrderPriceResponse}
     */
    ComputedOrderPriceResponse computedOrderPrice(OrderComputedPriceRequest request);

    /**
     * 创建订单
     * @param request 请求参数
     * @return {@code Map<String, String>}
     */
    Map<String, String> createOrder(CreateOrderRequest request);


    /**
     * 订单列表
     * @param status 类型
     * @param pageRequest 分页
     * @return {@code CommonPage<OrderDetailResponse>}
     */
    CommonPage<OrderDetailResponse> list(Integer status, PageParamRequest pageRequest);

    /**
     * 订单详情
     * @param orderId 订单id
     * @return {@code StoreOrderDetailInfoResponse}
     */
    StoreOrderDetailInfoResponse detailOrder(String orderId);

    /**
     * 订单状态数量
     * @return {@code OrderDataResponse}
     */
    OrderDataResponse orderData();

    /**
     * 删除订单
     * @param id 订单ID
     * @return {@code Boolean}
     */
    Boolean delete(Integer id);

    /**
     * 创建订单评价
     * @param request 请求参数
     * @return {@code boolean}
     */
    boolean reply(StoreProductReplyAddRequest request);

    /**
     * 订单收货
     * @param id 订单id
     * @return {@code boolean}
     */
    boolean take(Integer id);

    /**
     * 订单取消
     * @param id 订单id
     * @return {@code boolean}
     */
    boolean cancel(Integer id);

    /**
     * 获取申请订单退款信息
     * @param orderId 订单编号
     * @return {@code ApplyRefundOrderInfoResponse}
     */
    ApplyRefundOrderInfoResponse applyRefundOrderInfo(String orderId);

    /**
     * 订单退款申请
     * @param request 申请参数
     * @return {@code boolean}
     */
    boolean refundApply(OrderRefundApplyRequest request);

    /**
     * 查询退款理由
     * @return {@code List<String>}
     */
    List<String> getRefundReason();

    /**
     * 获取待评价商品信息
     * @param request 请求参数
     * @return {@code OrderProductReplyResponse}
     */
    OrderProductReplyResponse getReplyProduct(GetProductReplyRequest request);

    /**
     * 获取支付配置
     * @return {@code PreOrderResponse}
     */
    PreOrderResponse getPayConfig();

    /**
     * 通过订单号、用户ID查询数据
     * @param orderId 订单号
     * @param uid 用户ID
     * @return {@code StoreOrder}
     */
    StoreOrder getOrderIdAndUidToInfo(String orderId, Integer uid);
}
